home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / 1FWFAKB (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.2 KB  |  34 lines

  1. package sun.awt.image;
  2.  
  3. import java.io.BufferedInputStream;
  4. import java.io.FileInputStream;
  5. import java.io.FileNotFoundException;
  6.  
  7. public class FileImageSource extends InputStreamImageSource {
  8.    String imagefile;
  9.  
  10.    public FileImageSource(String filename) {
  11.       SecurityManager security = System.getSecurityManager();
  12.       if (security != null) {
  13.          security.checkRead(filename);
  14.       }
  15.  
  16.       this.imagefile = filename;
  17.    }
  18.  
  19.    final boolean checkSecurity(Object context, boolean quiet) {
  20.       return true;
  21.    }
  22.  
  23.    protected ImageDecoder getDecoder() {
  24.       BufferedInputStream is;
  25.       try {
  26.          is = new BufferedInputStream(new FileInputStream(this.imagefile));
  27.       } catch (FileNotFoundException var2) {
  28.          return null;
  29.       }
  30.  
  31.       return ((InputStreamImageSource)this).getDecoder(is);
  32.    }
  33. }
  34.